﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using AimGameEngine.EditorObject;

using AimGameLibrary;
using AimGameLibrary.GameObject;

namespace AimGameEngine.NodeEditorObject
{
    public class NodeDraw : NodeBaseControl
    {
        public Dictionary<String, NodeObject> DictionaryObjectDraw;

        public NodeDraw(SpriteBatch inputspritebatch, Camera inputcamera, NodeData inputData
            , List<IDraw> MyListDraw, List<IUpdateMainTime> MyListUpdateTime, Dictionary<String, NodeObject> MyListObject, Dictionary<String, NodeObject> MyListType)
            : base(inputspritebatch, inputcamera, inputData, MyListDraw,MyListUpdateTime, MyListObject, MyListType)
        {
            DictionaryObjectDraw = new Dictionary<string, NodeObject>();

            Connecter outputDraw = new Connecter(inputspritebatch, inputcamera, Syco.Output, NodeTypeValue.Draw, this);
            ListConnectpoint.Add(outputDraw);

            Connecter inputDraw = new Connecter(inputspritebatch, inputcamera, Syco.Input, NodeTypeValue.Draw, this);
            ListConnectpoint.Add(inputDraw);
        }

        public override void SetupInput(Connecter Thisconnect, Connecter connectOutput)
        {
            DictionaryObjectDraw.Add(connectOutput.MyNode.MyData.MyName, connectOutput.MyNode);
        }

        public override void ClearInput(Connecter ThisInputConnect, Connecter ThisConnectClear, string NameThisClear)
        {
            DictionaryObjectDraw.Remove(ThisConnectClear.MyNode.MyData.MyName);
        }

        protected override Dictionary<string, NodeObject> GetDictionaryNode(Dictionary<string, NodeObject> TempNode)
        {
            return base.GetDictionaryNode(DictionaryObjectDraw);
        }
    }
}
